<?php #//v.3.3.0

#///////////////////////////////////////////////////////
#//  COPYRIGHT 2007 Phpauction.net ALL RIGHTS RESERVED//
#///////////////////////////////////////////////////////

require('./includes/config.inc.php');

/* get active bids for this user */

        $query_settings3 = "select * from PHPAUCTIONXL_version_2_0 where id='1'";
                             $query_settings4 =  mysql_query ($query_settings3);
                                $intl_date_time1 = mysql_result($query_settings4,0,"intl_date_time");
                                     $autobidder1 = mysql_result($query_settings4,0,"hide_autobidder");
                                     
                                     
                                     
         $auction_id = intval($_GET['id']); 
// GET BID HISTORY

         $query_title1 = "select title,dbl_bidding from PHPAUCTIONXL_auctions where id=$auction_id";
                             $query_title2 =  mysql_query ($query_title1);
                                $title = mysql_result($query_title2,0,"title");
                                $dbl_bidding = mysql_result($query_title2,0,"dbl_bidding");

$query = "select * from PHPAUCTIONXL_bids2 where auction=$auction_id ORDER BY bid DESC";
$result_numbids = mysql_query ($query);
$num_auction2 = mysql_num_rows($result_numbids);


 $ii = 0;
             $tplv = "";

 
 
    if ( $dbl_bidding == 0 ) {

while($ii < $num_auction2) {

  

  $high_bidder 	= mysql_result($result_numbids,$ii,"current_high_bidder");
  
  if ( $ii > 1 ) { 
  $iii = $ii - 1;
  $high_bidder2 	= mysql_result($result_numbids,$iii,"current_high_bidder");
  }
$high_bid 	= mysql_result($result_numbids,$ii,"bid");
$ends_date = mysql_result($result_numbids,$ii,"bidwhen");
$auction_id2 = mysql_result($result_numbids,$ii,"auction");
    $proxy = mysql_result($result_numbids,$ii,"accounttype");  
   //$high_bidder2 	= mysql_result($result_numbids,$iii,"current_high_bidder"); 
    
   
   
   
   
   
    if ( $high_bidder2 != $high_bidder ) {
    


       $ends_h = "";

      if($rowclass == 0)
 
 { 
 $rowbackground = "row0";

 }
              
      if($rowclass == 1)
  { 
 $rowbackground = "row1";

$rowclass = -1;
 }        


$rowclass++;



      

                       $ends_y =       substr ($ends_date, 0, 4);
                       $ends_m =       substr ($ends_date, 4, 2);
                       $ends_d =       substr ($ends_date, 6, 2);
            
            
            if (substr ($ends_date, 8, 2)>12) {
  $ends_h .= "0";
$ends_h .= substr ($ends_date, 8, 2)-12;
$jsampm = "PM";
}
if (substr ($ends_date, 8, 2) < 12) {
$ends_h .= substr ($ends_date, 8, 2);
$jsampm = "AM";
}
     if (substr ($ends_date, 8, 2) == 12) {
$ends_h .= substr ($ends_date, 8, 2);
$jsampm = "PM";
}
if (substr ($ends_date, 8, 2) == 0) {
$ends_h .= substr ($ends_date, 8, 2);
$jsampm = "AM";
}
            
            
                       $ends_min =     substr ($ends_date, 10, 2);
                       $ends_sec =     substr ($ends_date, 12, 2); 
     
     
     
     
            
                         
             
                 $tplv .= "<tr VALIGN=MIDDLE BGCOLOR=\"\" id=$rowbackground>";

    
                    $bid = $currency_symbol;
                    $bid .=  print_money_nosymbol($high_bid);

                       $tplv .=
                       "<td align=center>".
                                              $bid.
                        "</td>";

                $tplv .= "</td>";
              $tplv .= "<td align=center>";   
                       
                       
                         if ( $proxy == "proxy" ) {
        
             if ( $autobidder1 == 1 ) {
        
        
        
        $tplv .= "<font color=red>* </font>";
        
        
              }
        
        }
                  
                $tplv .= $high_bidder;
                
                $tplv .= "</td>";
    if ( $intl_date_time1 != 1 ) {
         $tplv .= "<td align=center>$ends_m/$ends_d/$ends_y $ends_h:$ends_min:$ends_sec $jsampm</td>";
                   }
                       if ( $intl_date_time1 == 1 ) {
                       
                           $ends_h = substr ($ends_date, 8, 2)  ;
         $tplv .= "<td align=center>$ends_y-$ends_m-$ends_d $ends_h:$ends_min:$ends_sec</td>";
                   }
                   
                       $tplv .= "</tr>\r";    

}
     $ii++;
}
                      //$tplv .= "</TABLE>";  
             
 }            
             
             
             
              if ( $dbl_bidding == 1 )  {

while($ii < $num_auction2) {

  

  $high_bidder 	= mysql_result($result_numbids,$ii,"current_high_bidder");
  
  if ( $ii > 1 ) { 
  $iii = $ii - 1;
  $high_bidder2 	= mysql_result($result_numbids,$iii,"current_high_bidder");
  }
$high_bid 	= mysql_result($result_numbids,$ii,"bid");
$ends_date = mysql_result($result_numbids,$ii,"bidwhen");
$auction_id2 = mysql_result($result_numbids,$ii,"auction");
     
   //$high_bidder2 	= mysql_result($result_numbids,$iii,"current_high_bidder"); 
    
   
   

    


       $ends_h = "";

      if($rowclass == 0)
 
 { 
 $rowbackground = "row0";

 }
              
      if($rowclass == 1)
  { 
 $rowbackground = "row1";

$rowclass = -1;
 }        


$rowclass++;



      

                       $ends_y =       substr ($ends_date, 0, 4);
                       $ends_m =       substr ($ends_date, 4, 2);
                       $ends_d =       substr ($ends_date, 6, 2);
            
            
            if (substr ($ends_date, 8, 2)>12) {
  $ends_h .= "0";
$ends_h .= substr ($ends_date, 8, 2)-12;
$jsampm = "PM";
}
if (substr ($ends_date, 8, 2) < 12) {
$ends_h .= substr ($ends_date, 8, 2);
$jsampm = "AM";
}
     if (substr ($ends_date, 8, 2) == 12) {
$ends_h .= substr ($ends_date, 8, 2);
$jsampm = "PM";
}
if (substr ($ends_date, 8, 2) == 0) {
$ends_h .= substr ($ends_date, 8, 2);
$jsampm = "AM";
}
            
            
                       $ends_min =     substr ($ends_date, 10, 2);
                       $ends_sec =     substr ($ends_date, 12, 2); 
     
     
     
     
            
                         
             
                 $tplv .= "<tr VALIGN=MIDDLE BGCOLOR=\"\" id=$rowbackground>";

    
                    $bid = $currency_symbol;
                    $bid .=  print_money_nosymbol($high_bid);

                       $tplv .=
                       "<td align=center>".
                                              $bid.
                        "</td>";

                $tplv .= "</td>";
              $tplv .= "<td align=center>";   
                
                $tplv .= $high_bidder;
                
                $tplv .= "</td>";
    if ( $intl_date_time1 != 1 ) {
         $tplv .= "<td align=center>$ends_m/$ends_d/$ends_y $ends_h:$ends_min:$ends_sec $jsampm</td>";
                   }
                       if ( $intl_date_time1 == 1 ) {
                       
                           $ends_h = substr ($ends_date, 8, 2)  ;
         $tplv .= "<td align=center>$ends_y-$ends_m-$ends_d $ends_h:$ends_min:$ends_sec</td>";
                   }
                   
                       $tplv .= "</tr>\r";    


     $ii++;
}
                      //$tplv .= "</TABLE>";  
             
 }            
             
             
             
              $TPL_auctions_list_value = $tplv;

       include "header.php";
include phpa_include("template_complete_history_php.html");
include "footer.php";

?>